﻿using System;
using System.Collections.Generic;

namespace PoliticalClassifier.Support
{
    public interface IWeightManager : IEnumerable<IWeightAttribute>
    {
        /// <summary>
        /// Add a new weight in a manager.
        /// </summary>
        /// <param name="candidate">IWeightAttribute object</param>
        /// <returns>zero based index location of the added weight.</returns>
        int AddWeight(IWeightAttribute weightAttribute);

        /// <summary>
        /// Remove a weight from the manager
        /// </summary>
        /// <param name="index">zero based index location of the weight.</param>
        void RemoveWeight(int index);

        /// <summary>
        /// Update weightAttribute.Value.X and weightAttribute.Value.Y of the provided weightAttribute.Name.
        /// </summary>
        /// <param name="weight">WeightAttribute object representing a new Point2d Values</param>
        void UpdateWeight(IWeightAttribute weightAttribute);

        /// <summary>
        /// Returns the number of weights in a manager.
        /// </summary>
        int Count { get; }

        /// <summary>
        /// Returns Point2D for a given weight name.
        /// </summary>
        /// <param name="name">Weight name.</param>
        /// <returns>Point2D structure with both X and Y values.</returns>
        Point2D this[String name] { get; }

        /// <summary>
        /// Returns the IWeightAttribute at the given index.
        /// </summary>
        /// <param name="index">The index of the IWeightAttribute.</param>
        /// <returns>The IWeightAttribute at the index.</returns>
        IWeightAttribute this[int index] { get; }
    }
}
